const router = require('koa-router')()

const { list } = require('mockjs').mock({
  "list|100": [{
    "id": "@id",
    "title": "@ctitle",
    "pos": "@county(true)",
    "price|10-99": 1,
    "zhekou|1-99": 1,
    "sell|100-1000000": 1,
    "image|4-10": ["@image(120x80, @color)"],
    "commList|10-30": [{
      "id": "@id",
      "nickname": "@cname",
      "datetime": "@date",
      "content": "@cword(10, 20)",
      "avator": "@image(40x40, @color)"
    }] 
  }]
})

router.get('/list', ctx => {
  ctx.body = {
    code: 200,
    data: list
  }
})



module.exports = router
